package com.dinian.zeus.util;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import java.io.IOException;


/**
 * @Author dinian
 * @Date 2018-12-28
 */
@Slf4j
@RestControllerAdvice
public class GlobalExceptionHandler {

    //全局异常慎用  错误不可控  待优化
    /*@ExceptionHandler(Exception.class)
    public Result exception(Exception e){
        log.info(Result.error().toString());
        return Result.error(e.getMessage());
    }*/

    //@ExceptionHandler(IOException.class)
    public Result IOException(){
        log.info(Result.error().toString());
        return Result.error("上传失败");
    }
}
